import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/base/login/index.vue')
  },
  {
    path: '/registration',
    name: 'registration',
    component: () => import('@/views/base/registration/index.vue')
  },
  {
    path: '/forgotPassword',
    name: 'forgotPassword',
    component: () => import('@/views/base/forgotPassword/index.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/home/index.vue'),
    children: [
      {
        path: '/index',
        name: 'Index',
        component: () => import('@/views/index/index.vue')
      },
      {
        path: '/user',
        name: 'User',
        component: () => import('@/views/user/index.vue')
      }
    ]
  },
  {
    path: '/user/userInfo',
    name: 'UserInfo',
    component: () => import('@/views/userInfo/index.vue')
  },
  {
    path: '/user/userInfo/code',
    name: 'Code',
    component: () => import('@/views/userInfo/Code/index.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
